package indy.test.indy;

import java.lang.invoke.CallSite;
import java.lang.invoke.ConstantCallSite;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodHandles.Lookup;
import java.lang.invoke.MethodType;

public class IndyBSMOneArgPrimitiveTemplate {
    public static void main(String[] args) throws Throwable {
        if (indy() != 42) {
            throw new AssertionError();
        }
    }
    
    
    private static int indy() {
        throw new AssertionError();
    }

    public static CallSite bsm(@SuppressWarnings("unused") Lookup lookup,
                               @SuppressWarnings("unused") String name,
                               @SuppressWarnings("unused") MethodType type,
                               int value) throws Throwable {
        return new ConstantCallSite(MethodHandles.constant(int.class, value));
    }
}
